<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mobile extends CI_Controller {
    protected  $_data;
    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     * 		http://example.com/index.php/welcome
     *	- or -
     * 		http://example.com/index.php/welcome/index
     *	- or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */

    function __construct(){
        parent::__construct();
        $params = array(
            "appid" => "wx4f9673869a5e2182",
            "secret" => "067b389b979546fa190c768313630b88"
        );
        /*$params = array(
            "wx4f9673869a5e2182","067b389b979546fa190c768313630b88"
        );*/
        $this->load->library("jssdk", $params);
        $this->_data = array();
        $signPackage = $this->jssdk->getSignPackage();
        $this->_data['signPackage'] = $signPackage;
    }
    public function index()
    {
        $this->load->view("header",$this->_data);
        $this->load->view('index');
    }

    public function chose(){
        $this->load->view("header",$this->_data);
        $this->load->view('chose');
    }
    public function subview(){
        $this->load->view("header",$this->_data);
        $this->load->view('submit');
    }

    public function test(){
        $this->load->view("test");
    }

    public function sucview(){
        $this->load->view("header",$this->_data);
        $this->load->view("suc");
    }

    public function data(){
        $this->load->model("data_mod");
        $data = array();
        $data['result'] = $this->data_mod->pvdata();
        $this->load->view("report",$data);
    }

    public function mobileData(){
        $this->load->model("data_mod");
        $data = array("result" => null);
        $data['result'] = $this->data_mod->mobileData();
        //var_dump($data);exit();
        $this->load->view("mobileData",$data);
    }
}
